package cn.tonyandmoney.warescanapp.socket.dto

/**
 * Created by niantuo on 2018/4/1.
 * 从APP发过来的信息格式
 */
data class AppCheckDto(var code: Int = 0,
                       var message: String = "",
                       var epc: String = "",
                       var data: Any? = null) {

    constructor(code: Int, message: String) : this(code, message, "", null)


    fun fromDto(dto: AppCheckDto) {
        this.code = dto.code
        this.message = dto.message
        this.data = dto.data
    }

    fun reset() {
        code = -1
        message = "无操作"
        epc = ""
        data = ""
    }

    companion object {
        const val CODE_OUT = 2
        const val CODE_IN = 1
        const val CODE_CHECK = 3
        const val CODE_SCAN_STOP = 1000
    }
}
